import json

import requests

url = 'https://m.lagou.com/listmore.json?pageNo=2&pageSize=15'

headers = {
    'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Mobile Safari/537.36'
}

r = requests.get(url=url, headers=headers)
# 将获取的json数据进行utf-8解码 返回的是str格式
json_str = r.content.decode('utf-8')
json_dic = json.loads(json_str)  # 将str转为字典
print(r.json())  # 和 json_dic 内容相同 类型也相同
print(json_dic)  # 可以直接获取字典格式的json数据
print(type(r.json()))  # <class 'dict'>

